#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<iostream>
using namespace std;
class SV
{
 private:
	char *ten,*lop;
 public:
			
SV(char *t,char *l)
{
		 ten=new char[strlen(t)+1];
		 strcpy(ten,t);
		 lop=new char[strlen(l)+1];
		 strcpy(lop,l);
}
~SV()
{
		 delete ten;
		 delete lop;
}
void display()
{
		 cout<<"\n\n Ten: "<<ten;
		 cout<<"\t Lop: "<<lop;
}
};
class SVTC:public SV
{
 private:
	int hocphi;
 public:
SVTC(char *t,char *l,int hp=0):SV(t,l)
{
		 hocphi=hp;
}

void display()
{
		SV :: display();
		 cout<<"\t Hoc phi: "<<hocphi;
}
};
class SVCQ:public SVTC
{
 private:
	int diemtb,hocbong;
 public:
		
	 SVCQ (char *t,char *l,int hp,int dtb,int hb):SVTC(t,l,hp)
{
		 diemtb=dtb;
		 hocbong=hb;
}
void display()
{
	SVTC::display();
	cout<<"\t Diem TB: "<<diemtb;
	cout<<"\t Hoc bong: "<<hocbong;
}
int operator>(SVCQ &d)
{
		 if(diemtb>d.diemtb)
                    return 1; 
                 return 0;
}
};